﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<PhotoGalleryEnteties.PhotoInfo>>" %>
<%@ Import Namespace="PhotoGalleryEnteties" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Last <%:Model.Count( ) %> photos
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script type="text/javascript" >
        $(window).load(function () {
            $(".photoPanel img").each(function () {
                var a = $(this);
                a[0].width > a[0].height ? a.width(400) : a.height(400);
            });
            $(".photoPanel").show();
        });
   
    </script>
    <h1>Last <%:Model.Count( ) %> saved photos</h1>
    <%foreach (PhotoInfo photo in Model)
      {%>
      <%Html.RenderPartial("RandomPhoto", photo);%>
      <%}%>

</asp:Content>
